package com.yingside.collection.game;

public class Vampire extends Enemy{

	int suckBlood;
	int maxHp;

	public Vampire(int type){
		switch(type){
			case 1:
				this.name = "吸血鬼蝙蝠";
				this.maxHp = 50;
				this.attack = 8;
				this.defence = 6;
				this.suckBlood = 40;
				this.money = 50;
				break;
			case 2:
				this.name = "吸血鬼僵尸";
				this.maxHp = 70;
				this.attack = 9;
				this.defence = 8;
				this.suckBlood = 50;
				this.money = 80;
				break;
			case 3:
				this.name = "吸血鬼男爵";
				this.maxHp = 100;
				this.attack = 11;
				this.defence = 9;
				this.suckBlood = 60;
				this.money = 150;
				break;
			case 4:
				this.name = "吸血鬼伯爵";
				this.maxHp = 150;
				this.attack = 18;
				this.defence = 16;
				this.suckBlood = 90;
				this.money = 350;
				break;
		}

		this.hp = this.maxHp;
	}


	//怪兽反击英雄
	public void response(Hero h){
		System.out.println(this.name + "挥舞着锋利的爪子,冲向了-->" + h.getName());
		int demage = h.injured(this);

		int addBlood = demage * suckBlood / 100;

//		if(addBlood <= 0){
//			addBlood = 1;
//		}
//
//		if(addBlood + this.hp >= this.maxHp){
//			this.hp = this.maxHp;
//		}
//		else{
//			this.hp = this.hp + addBlood;
//		}

		this.hp = this.hp + addBlood;
		System.out.println("哈哈哈,吸你的血...嘻嘻嘻嘻...可以吸的果冻..." + this.name + ",吸血:" + addBlood + ",剩余血量:" + this.hp);
	}





}
